/*
 * Copyright 2009-2017 Alibaba Cloud All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <alibabacloud/trademark/model/GenerateQrCodeResult.h>
#include <json/json.h>

using namespace AlibabaCloud::Trademark;
using namespace AlibabaCloud::Trademark::Model;

GenerateQrCodeResult::GenerateQrCodeResult() :
	ServiceResult()
{}

GenerateQrCodeResult::GenerateQrCodeResult(const std::string &payload) :
	ServiceResult()
{
	parse(payload);
}

GenerateQrCodeResult::~GenerateQrCodeResult()
{}

void GenerateQrCodeResult::parse(const std::string &payload)
{
	Json::Reader reader;
	Json::Value value;
	reader.parse(payload, value);
	setRequestId(value["RequestId"].asString());
	if(!value["Uuid"].isNull())
		uuid_ = value["Uuid"].asString();
	if(!value["ExpireTime"].isNull())
		expireTime_ = std::stol(value["ExpireTime"].asString());
	if(!value["QrcodeUrl"].isNull())
		qrcodeUrl_ = value["QrcodeUrl"].asString();
	if(!value["FieldKey"].isNull())
		fieldKey_ = value["FieldKey"].asString();
	if(!value["Success"].isNull())
		success_ = value["Success"].asString() == "true";

}

std::string GenerateQrCodeResult::getQrcodeUrl()const
{
	return qrcodeUrl_;
}

std::string GenerateQrCodeResult::getUuid()const
{
	return uuid_;
}

long GenerateQrCodeResult::getExpireTime()const
{
	return expireTime_;
}

bool GenerateQrCodeResult::getSuccess()const
{
	return success_;
}

std::string GenerateQrCodeResult::getFieldKey()const
{
	return fieldKey_;
}

